import axios from 'axios'
export const getcollect = async (userid) => {
  return axios({
    url: 'http://localhost:3000/collect',
    params: {
      userid: userid,
    }
  })
}
export const getcollectByShopId = async (userid) => {
  let res = await getcollect(userid)
  let data = []
  for (let k of res.data) {
    let res2 = await axios({
      url: 'http://localhost:3000/classes/' + k.collectid,
    })
    data.push(res2.data)
  }
  return data
}
